home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / graphics / texdraw / txdps.tex < prev    next >
Text File  |  1992-07-06  |  2KB  |  56 lines

  1. % TeXdraw macros to access PostScript builtins
  2.  
  3. % $Id: txdps.tex,v 1.6 1992/07/07 14:40:40 kabal Rel $
  4.  
  5. %   Copyright (C) 1991, 1992  Peter Kabal
  6.  
  7. % The routines in this file are provided free of charge without
  8. % warranty of any kind.  Note that the TeXdraw routines are copyrighted.
  9. % They may be distributed freely provided that the recipients also
  10. % acquire the right to distribute them freely.  The notices to this
  11. % effect must be preserved when the files are distributed.
  12.  
  13. %  Peter Kabal
  14. %  Department of Electrical Engineering
  15. %  McGill University
  16. %  3480 University
  17. %  Montreal, Quebec
  18. %  Canada  H3A 2A7
  19.  
  20. %  kabal@aldebaran.EE.McGill.CA
  21.  
  22. % ===============================================================
  23.  
  24. \chardef\catamp=\the\catcode`\@
  25. \catcode`\@=11
  26.  
  27. % The TeXdraw macros assume that a PostScript currentpoint is always
  28. % defined. When using the following macros, always finish off with
  29. % by reestablishing a PostScript currentpoint. This can be done with
  30. % a \PSmoveto command.
  31.  
  32. \def\PSsetlinecap #1 {\writeps{#1 setlinecap}}
  33. \def\PSsetlinejoin #1 {\writeps{#1 setlinejoin}}
  34. \def\PSstroke {\writeps{stroke}}
  35. \def\PSnewpath {\writeps{newpath}}
  36. \def\PSclosepath {\writeps{closepath}}
  37. \def\PSfill {\writeps{fill}}
  38. \def\PSlineto (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy
  39.                       \s@etpospix \a@rgx \a@rgy
  40.                       \writeps {\the\x@pix\space \the\y@pix\space lineto}}
  41. \def\PSmoveto (#1 #2){\getpos (#1 #2)\a@rgx\a@rgy
  42.                       \s@etpospix \a@rgx \a@rgy
  43.                       \writeps {\the\x@pix\space \the\y@pix\space moveto}}
  44. \def\PSarc r:#1 sd:#2 ed:#3 (#4 #5){\getpos (#4 #5)\a@rgx\a@rgy
  45.                                     \s@etpospix \a@rgx \a@rgy
  46.                                     \coordtopix {#1}\t@pixa
  47.                                     \writeps{\the\x@pix\space \the\y@pix\space
  48.                                              \the\t@pixa\space #2 #3 arc}}
  49. \def\PSarcn r:#1 sd:#2 ed:#3 (#4 #5){\getpos (#4 #5)\a@rgx\a@rgy
  50.                                      \s@etpospix \a@rgx \a@rgy
  51.                                      \coordtopix {#1}\t@pixa
  52.                                      \writeps{\the\x@pix\space \the\y@pix\space
  53.                                               \the\t@pixa\space #2 #3 arcn}}
  54.  
  55. \catcode`\@=\catamp
  56.